package com.lq.ecoldchain.ui.main.my

import com.lq.ecoldchain.base.CommonLoadingViewModel
import com.lq.ecoldchain.ui.main.MAIN_MODULE_TAG
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2018/12/25 0025  14:20
*function by lq
*/
const val MINE_KODEIN_MDEL = "mine_kodein_model"
val minekodeinModel =  Kodein.Module(MINE_KODEIN_MDEL) {

    bind<MineViewModel>() with scoped(AndroidLifecycleScope).singleton {
        MineViewModel(instance())
    }

    bind<MineDelegate>() with scoped(AndroidLifecycleScope).singleton {
        MineDelegate(
                viewModel = instance(),
                loadingViewModel = CommonLoadingViewModel.instance(context)
        )
    }

}